<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * FormativeLab
 *
 * An open source application development framework for PHP 5.1.6 or newer
 *
 * @package		FormativeLab
 * @author		FormativeLab Dev Team
 * @copyright	Copyright (c) 2011 - 2013, FormativeLab, Inc.
 * @license		http://www.formativesoft.com/license/
 * @link		http://www.formativesoft.com/
 * @since		Version 2.0
 * @filesource ./application/controllers/Rest.php
 */

// ------------------------------------------------------------------------

/**
 * FormativeLab Rest Controller
 *
 * @package		FormativeLab
 * @subpackage	controllers
 * @category	controllers
 * @author		Formative Soft Ltd
 * @link		http://www.formativesoft.com/
 */

// ------------------------------------------------------------------------

class Rest extends FSL_Controller {

	static $helper	= array();
	static $model	= array('M00I001');

	public function __construct(){
        parent::__construct('defaults');
		$this->load->helper(self::$helpers);
		$this->load->model(self::$models);
    }	
	
	public function index(){
		//X-Requested-With:XMLHttpRequest
		$this->render->response();
	}
	
	public function save(){		
		echo 'hello';
	}
	
	public function update(){		
		echo 'hello';
	}
	
	public function lang(){
		$this->lang->load('shahed', 'bangla');
		echo $this->lang->line('name');
	}
	
	public function json($offset=0, $limit=10){		
		$data   	= $this->M00I001->all($limit, $offset);
		$jsonData 	= $this->M00I001->getJsonData($data, 10, true, 'successed!');
		
		$this->output->set_status_header(200);
		$this->output->set_header('Content-type: application/json; charset=utf-8');
		$this->output->set_output($jsonData);
	}	
}

/* End of file Rest.php */
/* Location: ./application/controllers/Rest.php */